<?php defined('SYSPATH') or die('No direct access allowed.');

class Model_Tools extends ORM
{
    //获取高德地图导航地址
    public static function get_gd_map_url()
    {
        //微信浏览器
        if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false )
        {

            return '';

        }
        else if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad'))
        {
            return 'iosamap://path?sourceApplication=situcms&sid=BGVIS1&sname=我的位置&did=BGVI2&dlat={#DLAT#}&dlon={#DLNG#}&dev=0&t=0';
        }
        else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android'))
        {
            return 'amapuri://route/plan/?sname=我的位置&dlat={#DLAT#}&dlon={#DLNG#}&dev=0&t=0';

        }
        else
        {
            return '';
        }
    }
}